Utilizing magnetic field based navigation

ABSTRACT

There is provided a solution comprising detecting that a positioning device is within a predetermined control area associated with a building, acquiring a first sequence of magnetic field measurements carried out by the positioning device, wherein the first sequence represents at least one of the magnitude and the direction of Earth&#39;s magnetic field; determining that an operational environment of the positioning de-vice has changed between an indoor environment and an outdoor environment when a at least one predetermined criterion with respect to the first sequence is met; and causing actuation of a predetermined software function in or with respect to the positioning device when the operational environment of the positioning device has changed.

FIELD

The invention relates generally to indoor positioning systems. Moreparticularly, the invention relates to utilization of the magnetic fieldbased navigation, such as in detecting a change in the operationalenvironment and initialization of a positioning device for locationdiscovery and/or tracking.

BACKGROUND

It may be of importance to locate or track a user when the user isinside a building. However, a well-known outdoor positioning systememploying a global positioning system (GPS) or any other satellite basedsystem may not work inside a building due to lack of reliable receptionof satellite coverage. Therefore, a positioning technique utilizingEarth's magnetic fields (EMF) indoors has been developed as one possibleoption for indoor location discovery. This type of location discoveryapplies, for example, a magnetic field strength measured by apositioning device. However, problems are related to this type oflocation estimation, especially in how to detect a change in theoperational environment and how to initialize the positioning device forapplying the EMF based positioning technique, for example.

BRIEF DESCRIPTION OF THE INVENTION

According to an aspect of the invention, there is provided an apparatusas specified in claim 1.

According to an aspect of the invention, there is provided a method asspecified in claim 12.

According to an aspect of the invention, there is provided a computerprogram product embodied on a distribution medium readable by a computerand comprising program instructions which, when loaded into anapparatus, execute the method according to claim 12.

According to an aspect of the invention, there is provided an apparatuscomprising means configured to cause the apparatus to perform any of theembodiments as described.

Embodiments of the invention are defined in the dependent claims.

LIST OF DRAWINGS

In the following, the invention will be described in greater detail withreference to the embodiments and the accompanying drawings, in which

FIG. 1 presents a floor plan of a building;

FIGS. 2A to 2C show a positioning device and an example measuredmagnetic field vector;

FIG. 3 shows a method according to an embodiment;

FIGS. 4A, 4B and 5 illustrate embodiments relating to detecting a changeof operational environment, according to some embodiments;

FIGS. 6A and 6B present some embodiments relating to identification ofentry location;

FIGS. 7A to 7C show possible three dimensional orientations of thepositioning device;

FIG. 8 illustrates an embodiment relating to a low range data transfer;

FIG. 9 shows an embodiment relating to deviation from expected path; and

FIGS. 10 and 11 illustrate apparatuses according to embodiments.

DESCRIPTION OF EMBODIMENTS

The following embodiments are exemplary. Although the specification mayrefer to “an”, “one”, or “some” embodiment(s) in several locations ofthe text, this does not necessarily mean that each reference is made tothe same embodiment(s), or that a particular feature only applies to asingle embodiment. Single features of different embodiments may also becombined to provide other embodiments.

In order to enable positioning, a radio frequency (RF) and/or GPS basedlocation discovery and/or tracking is known. The GPS location discoverymay not, however, be suitable for indoors due to lack of satellitereception coverage. Also the RF based location discovery and locationtracking may only be possible by determining the indoor base station towhich the user device is connected to, a round trip time of the RFsignal, or the power of the received RF signal, for example. This typeof location tracking may suffer from a lack of accuracy, for example,when the user gets located by two different RF base stations. Also, thecoverage area of one base station may be wide resulting in pooraccuracy. Some other known positioning measures, which may be applicableindoors, include machine vision, motion sensor and distance measuring,for example. However, each of these requires expensive measuring devicesand equipment mounted throughout the building. As a further option, theutilization of Earth's magnetic field (EMF) may be applied.

The material used for constructing the building may affect the EMFmeasurable in the building and also the EMF surrounding the building.For example, steel, reinforced concrete, and electrical systems mayaffect the EMF. The EMF may vary significantly between differentlocations in the building and may therefore enable accurate locationdiscovery and tracking inside the building based on the EMF localdeviations inside the building. On the other hand, the equipment placedin a certain location in the building may not affect the EMFsignificantly compared to the effect caused by the building material,etc. Therefore, even if the layout and amount of equipment and/orfurniture, etc., change, the measured EMF may not change significantly.

An example of a building 100 with 5 rooms, a corridor and a hall isdepicted in FIG. 1. It is to be noted that the embodiments of theinvention are also applicable to other type of buildings, includingmulti-floor buildings. The floor plan of the building 100 may berepresented in a certain frame of reference. A frame of reference mayrefer to a coordinate system or set of axes within which the position,orientation, etc. are measured, for example. Such a frame of referenceof the building in the example of FIG. 1 may be an XY coordinate system,also known in this application as the world coordinate system. Thecoordinate system of the building 100 may also be three dimensional whenvertical dimension needs to be taken into account. The verticaldimension is referred with Z, whereas X and Y together define ahorizontal two-dimensional point (X,Y). In FIG. 1, the arrow starting ata point (X1, Y1) and ending at a point (X2, Y2) may be seen as a path102 traversed by a user associated with an EMF positioning device. The Zdimension is omitted for simplicity. The positioning device is detailedlater, but for now it may be said, that the positioning device maycomprise a magnetometer or any other sensor capable of measuring theEMF, such as a Hall sensor or a digital compass. The magnetometer maycomprise at least one orthogonal measuring axis. However, in anembodiment, the magnetometer may comprise three-dimensional measuringcapabilities. Yet in one embodiment, the magnetometer may be a groupmagnetometer, or a magnetometer array which provides magnetic fieldobservation simultaneously from multiple locations spaced apart. Themagnetometer may be highly accurate sensor and even small variations inthe EMF may be noticed. In addition to the strength, also known asmagnitude, intensity or density, of the magnetic field (flux), themagnetometer may be capable of determining a three-dimensional directionof a measured EMF vector. To this end, it should be noted that at anylocation, the Earth's magnetic field can be represented by athree-dimensional vector. Let us assume that a compass needle is tied atone end to a string such that the needle may rotate in any direction.The direction the needle points, is the direction of the Earth'smagnetic field vector.

As said, the magnetometer carried by a person traversing the path 102 inFIG. 1 is capable of determining the three-dimensional magnetic fieldvector. Example three components of the EMF vector as well as the totalstrength are shown in FIG. 2A throughout the path 102 from (X1, Y1) to(X2, Y2). The solid line 200 may represent the total strength of themagnetic field vector and the three other lines 202 to 206 may representthe three component of the three dimensional magnetic field vector. Forexample, the dot-dashed line 202 may represent the Z component (verticalcomponent), the dotted line 204 may represent the X component, and thedashed line 206 may represent the Y component. From this information,the magnitude and direction of the measured magnetic field vector may beextracted. FIG. 2B shows how the Earth's magnetic field 208 may bepresent at the location of an object 210. In FIG. 2B, the object 210 isoriented in the three-dimensional space (XYZ) according to the frame ofreference of the building. However, typically the object is moving andthe three-dimensional orientation of the object 210 may vary from theframe of reference of the building as shown in FIG. 2C. In this case,the three-dimensional frame of reference is not for the building but forthe object 210, such as for the positioning device. Such frame ofreference may be denoted with X′, Y′, and Z′ corresponding to rotated X,Y, and Z of the world coordinate system. The G vector in FIG. 2C denotesthe gravitational force experienced by the object 210.

In location tracking of the user or any target object moving in thebuilding 100, the EMF vector measured by the positioning device carriedby the user may be compared to existing information, wherein theinformation may comprise EMF vector strength and direction in severallocations within the building 100. The information may depict an indoorEarth's magnetic field map. The positioning device of the user maycomprise at least part of the EMF map, the positioning device may accessthe EMF map stored somewhere else in a network accessible by thepositioning device, or the positioning device may forward the measuredEMF vector data to a database entity or server which comprises or hasaccess to the EMF map and thus is capable to locate the user in thefloor plan of the building. Preferably but not necessarily, the EMF mapcovers most or all of the building so that the user may be reliablylocated without “black spots”.

However, it may be cumbersome and time consuming for the user to detecta change in the operational environment, such as a change betweenindoors (e.g. the building 100) and outdoors, and perform requiredactions based on that. At least partly for this reason, a solution isprovided in which it is, with reference to FIGS. 3, 4A and 4B, detectedin step 300 that the positioning device (PD) 400 is within apredetermined control area 402A, 402B associated with a building, suchas a building 100, for example. The control area 402A may be inside thebuilding 100 or the control area 402B may be outside the building 100.The control area 402A, 402B may have a regular form, such as a circlearound an entry door 412A, 412B, for example. Alternatively, the controlarea 402A, 402B may have an irregular form. The control areas 402A and402B may be defined to be partly overlapping. Also, the control area402B may be somewhere inside the building 100, not necessarilycomprising or being coupled to the entry door 412A, 412B. Alternatively,the control area 402A may be somewhere outside the building 100, notnecessarily comprising or being coupled to the entry door 412A, 412B. Inan embodiment, it may be detected that the PD 400 is within the controlarea 402A or 402B on the basis of positioning information obtained fromthe outdoor positioning system and/or from the magnetic field basedpositioning system. As said, the outdoor positioning system may be asatellite 404 based navigation system or an RF signal based navigationsystem, for example. When the control area 402B is indoors, the presenceof the positioning device 400 within the control area may be determinedon the basis of EMF based navigation system applying an existing EMF mapof the building 100, or some other indoor navigation system, forexample. However, in an embodiment, the presence of the PD 400 in theoutdoor control area 402A may also be detected by applying the magneticfield based positioning system. This is because, for example, inlocations with a high density of buildings, such as in cities, themagnetic field variations may be large also outside the buildings (i.e.in the control area 402A in front of the entry 412A). The detection ofthe PD 400 being present in the location area may be made by theposition device itself (if the PD 400 has knowledge of the control areas402A, 4028), or by a database entity 500 to which location relatedinformation from the PD 400 is sent via a wireless interface. Thedatabase entity 500 may have access or comprise the required informationrelated to the EMF map of the building and to the control area 402,402B, for example.

Further, it is proposed to acquire in step 302 a first sequence ofmagnetic field measurement carried out by the PD 400 upon detecting thatthe PD 400 is within the predetermined control area 402A, 4028. Let usassume that the PD 400 traverses a path 406A in FIGS. 4A and 407A inFIG. 48. In FIG. 4A, the PD 400 is located outdoors. The arrival of thePD 400 at the control area 402A at point 408 may be detected by means ofGPS 404, for example. As the PD 400 arrives to the control area 402A atpoint 408, the PD 400 may start to activate a magnetometer in order tomake EMF measurements 208 from which the first sequence is determined.It may be advantageous to determine such control area 402A so that themagnetometer of the PD 400 need not be on all the time, but it may betriggered on when the PD 400 is at the control area 402A. In FIG. 4B,the PD 400 is indoors and the arrival of the PD 400 to the control area402B along path 407A may be detected from EMF 208 based navigationsystem. Here, depending on the circumstances, the PD 400 may havealready been applying such EMF based navigation system indoors evenbefore arriving to the control area 402B which may provide requiredinformation for detecting the arrival of the PD 400 to the control area4028. Alternatively, the arrival of the PD 400 to the control area 402Bmay be known from another indoor location discovery and/or trackingsystem. These may employ RF based navigation, odometer, inertialmeasurement units, at least one camera taking images which images arecompared to an image database in order to detect the location of the PD400, etc. As the PD 400 arrives to the control area 4028 at point 409,the PD 400 may start or continue to make EMF measurements 208 from whichthe first sequence is determined. The first sequence may represent atleast one of the magnitude and the direction of Earth's magnetic field.In one embodiment, the EMF measurements may provide informationregarding the XYZ components of the EMF 208, as shown in FIG. 2A, fromwhich the direction and/or magnitude are derivable. However, in oneembodiment, only the magnitude is obtained without separating the XYZcomponents of the EMF. The first sequence may comprise at least one EMFmeasurement. The first sequence may be updated continuously or accordingto predetermined intervals with new measurements from the PD 400. Thus,the length of the first sequence may increase as the PD 400 moves alongthe path 406A or 40M. The PD 400 may acquire the first sequence bymeasuring the EMF 208. Alternatively or in addition to, the databaseentity 500 may acquire the first sequence by receiving data related tothe first sequence or to the measured EMF 208 from the PD 400.

Further, it is proposed to determine in step 304 that an operationalenvironment of the positioning device 400 has changed between an indoorenvironment and an outdoor environment when at least one predeterminedcriterion with respect to at least part of the first sequence is met.The at least one predetermined criterion is detailed later but for nowit may be said that the first sequence may be monitored alone or incomparison to another sequence. The first sequence may be monitoredcontinuously in order to detect the change in the operationalenvironment or it may be monitored according to predetermined intervals,or it may be monitored once the EMF 208 measurements to be comprised inthe first sequence are finished, which may take place once apredetermined time limit expires, for example. The change of operationalenvironment may be detected when the PD 400 has moved from outdoor toindoors at point 410 of FIG. 4A, or from indoors to outdoors at point411 in FIG. 4B. It should also be noted that the detection of the changemay be performed by the positioning device 400 or by a database entity500. In the latter case, the positioning device 400 may wirelessly beconnected to the database entity 500 performing the computationalprocessing related to the detection, for example.

In an embodiment, when it is detected in step 304 that the operationalenvironment of the positioning device 400 has changed at point 410 or atpoint 411, an actuation of a predetermined software function in or withrespect to the positioning device 400 may be automatically caused instep 306. The database entity 500 may cause the activation by sending acommand to the PD 400, or the PD 400 may cause the activation itself.Such a predetermined software function may comprise for example anavigation system. When the operational environment changes fromoutdoors to indoors or from indoors to outdoors, it may be advantageousto change into using a corresponding navigation system. Therefore, anactivation of either an application employing an indoor magnetic fieldbased positioning system or an application employing an outdoorpositioning system may be caused in the positioning device 400 when theoperational environment of the positioning device 400 has changed. Theapplication employing the indoor magnetic field may use an indoormagnetic field map representing at least one of magnitude and directionof Earth's magnetic field 208 affected by the local structures of thebuilding 100 at a given location inside the building 100. This way theembodiment provides a seamless navigation even if the user moves fromoutdoors to indoors, or vice versa. By knowing or accessing the existingEMF map data, the PD 400 may be able to determine its location in thebuilding 100 by comparing the measured EMF vector to the EMF map.

In another embodiment, such a predetermined software function maycomprise for example a reference to a social network. For example, sucha reference may be a check-in to the Facebook Places, Foursquare socialnetwork, a status update to the Facebook, or to the Twitter, wherein thestatus update refers to the location of the user associated with the PD400, for example. In other words, when it is detected that theoperational environment has changed, for example, from outdoors toindoors, the PD 400 may automatically check-in to the Foursquare. Thismay be advantageous for the user so that the user need not himselfperform the reference to the social network. Further, as will bedescribed later, the entry of the building among a plurality of entriesmay optionally be detected. This may further aid in specifying thecheck-in location of the user to the building so that the check-inlocation may correspond to the specific entry of the building.

Let us now take a look at how it is determined that the operationalenvironment has changed. FIG. 5 shows an example first sequence 420obtained from measurements carried out by the PD 400 along traversingthe path 406A of FIG. 4A, for example. For simplicity reasons, only themagnitude of the EMF 208 is depicted by the first sequence 420. It maybe that the PD 400 has measured only the magnitude, or it may be thatthe magnitude is derived from the XYZ components of the measured EMF208. It should be noted that the detection of operational environmentchange may be similarly detected by observing the direction of the EMF208 from the measured EMF vector, in case the first sequence 420 depictsthe XYZ components of the EMF 208. In addition to or alternatively, theXYZ components of the EMF vector 208 may be observed separately in orderto detect the operational environment change. Such use of multipleparameters may further aid in the detection. In particular, it is to benoted that a behavior of a first sequence representing the vector of theEMF 208 may change when moving from outdoors to indoors, or vice versa.However, as said, in FIG. 5 only the magnitude of the EMF 208 isdepicted for simplicity reasons. It may be seen that the magnitude ofthe EMF 208 changes at point 410, i.e. at the point of entry to thebuilding 100. This is because the EMF 208 is then affected by the localstructures of the building 100, such as reinforced concrete walls, steeldoor frames, etc. From such a change in at least one property of thefirst sequence 420, it may be derived that the operational environmenthas changed. Thus, in an embodiment, the at least one criterion is apredetermined change in a property derivable from the first sequence420. The property may be any property obtained from the sequence 420. Anexample property is a statistical property, such as at least one of thefollowing: a variance of the first sequence 420, a peak amplitude of thefirst sequence 420, an expectation value of the first sequence 420, afrequency spectrum of the first sequence 420. When, for example, thevariance of the first sequence 420 increases, it may be detected thatthe PD 400 has moved to indoors. The variance, for example, may bedetermined on a sliding window basis, wherein the window captures apredetermined length of the first sequence 420. Then, the window ismoved and it is detected if the (local) variance is different from theprevious window. Alternatively, the property may be observedcontinuously as the length of the first sequence 420 increases. When theproperty, such as the expectation value, changes sufficiently, it may bedetected that the operational environment has changed. There may be apredetermined threshold (based for example on empirical experiments)which is used to determine if the change in the property is sufficientfor a classifier to detect a change in the operational environment. Ascan be seen from the first sequence 420 presented in FIG. 5, thevariance of the sequence 420 outdoors (before the point 410) isrelatively low, whereas the variance indoors (after the point 410) has ahigher value. Similarly it may be seen that changes in the peakamplitude, in the expectation value and in the frequency spectrum takeplace when looking at the first sequence 420 on both sides of the point410.

In an embodiment, the at least one criterion is a predeterminedsimilarity between the first sequence 420 and a second magnetic fieldsequence 422, as shown in FIG. 5. The second sequence 422 may bedetermined beforehand and represent a true magnetic field sequence for apath comprising a change of operational environment, such as a part orwhole of one of the paths 406A or 406B comprising the entry 412A, 412B,respectively. In practice it may be that a part or whole of the path406A, for example, has been measured in a controlled manner so as toobtain the second sequence 422. The prior measurement may have beenmeasured several times to ensure the reliability. The part of the path406A may comprise the vicinity of the entry 412A, for example. In thisembodiment, the sequences 420 and 422 in FIG. 5 may be seen to representthis relatively short part of the path 406A, wherein the short partcomprises the entry 412A to the building 100. In meters, the length ofthe sequence 422 may be for example couple of meters, such as around twometers. By comparing the two sequences 420 and 422, the similarity orcorrelation may be determined, for example, as a cross-correlationvalue, or by applying a dynamic time warping (DTW) algorithm, which isan algorithm for measuring similarity between two sequences which mayvary in time or speed. If the similarity value exceeds a predeterminedthreshold, then it may be determined that the operational environmenthas changed. This embodiment may provide a reliable indicator for achange of an indoor-to-outdoor transition or vice versa.

As said, the second sequence 422 may be obtained from prior measurementscarried out in a controlled manner. The controlled manner may refer tothe three-dimensional orientation of a measuring device, as will bedescribed later. In an embodiment, as shown in FIG. 6A, the secondsequence 422 for at least one predetermined path 606A, 606B may beacquired based on magnetic field 208 measurements carried out by atleast one measuring device 600. Each of the at least one predeterminedpaths 606A, 606B comprises an entry to the building, such as the entry412A, 412B, respectively, to the building 100. The path 606A may thus beseen as part of the path 406A, for example. The measuring device 600 maybe a client of a social network or a special purpose measurement device,for example. For example, a client (a user) of the Foursquare orFacebook Places, may manually indicate in the application which buildinghe/she has entered. The client may also indicate the entry location ofthe building. As this is part of the client's typical behavior, it isadvantageous that such clients may also, when entering the building,measure the EMF 208 during the path 606A, 606B of entry. In this manner,the data sequence 422 is obtained for the indicated entry. As there aremany users making such reference to the social network, the number ofEMF sequences 422 acquired for one path 606A, 606B may be high, thusincreasing reliability. Alternatively, the measurement may be made by aspecial purpose measurement device individually for each path 606A,606B. In this way the reliability of correct second sequence 422 ishigh. Moreover, each measuring device 600 or user associated to themeasuring device 600 may add attributes or context (metadata) to thesecond sequence 422, such as who measured it, what was the date and timeof the measurement, were there any disturbances, etc. These may be usedto verify the reliability of the measurement, and thus the reliabilityof the comparison between the first sequence 420 and the second sequence422.

In an embodiment, as shown in Figures in 6A and 68, it may be assumedthat the at least one measuring device 600 has measured the path 606A,606B, each path 606A, 606B comprising an entry 412A, 412B to thebuilding. The acquired second sequences 422A and 422B, respectively, maybe seen in FIG. 6B. As the EMF sequences 422A and 422B are obtained andthey may be identified to the specific entries 412A and 412B, the placeof entry of the positioning device 400 travelling either of the paths606A or 606B (as part of the routes 406A, 406B) may be accuratelydetermined. This may be done by comparing the first magnetic fieldsequence 420 and the at least one second, true magnetic field sequence422A, 422B in order to obtain a path hypothesis for the positioningdevice 400. Although FIG. 6B shows only magnitude, the comparison may bemade, alternatively or additionally, between the directions of themeasured first sequence 420 and the predetermined second sequences 422A,4022B and/or between the XYZ components of the measured first sequence420 and the predetermined second sequences 422A, 4022B. The pathhypothesis may be acquired for both of the paths 606A, 606B. However,typically one of the path hypothesis show higher probability of accuracybased on the similarity measure between the first sequence 420 and thesecond sequence 422A, 422B. As a consequence, it may be possible todetermine which of the at least one predetermined path 606A, 606B thepositioning device 400 has traversed on the basis of the comparison. Forexample, the first sequence 420 may be compared (continuously, atpredetermined intervals, on a sliding window basis, or at the end) toboth of the seconds sequences 422A, 422B. Then, a similarity measure isdetermined for both of the second sequences 422A, 4228 and the oneshowing sufficient similarity may be selected as the point of entry.Such comparison may take place by using a pattern recognition methodwhere the measured first sequence 420 is compared to the true secondsequences 422A, 422B. For example, in FIG. 6B it may be determined thatthe similarity between the first sequence 420 and the second sequence422A is higher than the similarity between the first sequence 420 andthe second sequence 422B. Thus, it may be determined that the PD 400 hastraversed path 606A, i.e. has entered to the building through the entry412A. It may be advantageous to perform such comparison so that, notonly the change of operation environment is detected, but also the exactlocation of entry may be identified without needing the EMF map for thewhole building of entry. Only EMF map for the entry locations 412A, 412Bmay be used. Knowing the exact location of entry in to the building 100,may serve as a trigger to cause the initialization of the PD 400 with atleast part of the EMF map of the building 100, wherein the part of theEMF map comprises at least the location of entry 412A, 4128.

A further advantage may be that the positioning device 400 may beinitialized with the indoor location estimate corresponding to theidentified location, i.e. the entry 412A or 4128. To enable the correctinitial location estimation significantly enhances the efficiency ofindoor positioning system, such as the EMF based navigation system. Forexample, when the indoor positioning system applies a multi-hypothesislocation estimation, the number of different hypothesis may in thebeginning include over 1000 location hypothesis for the positioningdevice 400. Therefore, it may be understood that it may take a lot oftime to converge to the correct hypothesis. By enabling the initiallocation estimate, the efficiency of the location discovery is increasedas the number of location hypothesis may be reduced closer to theidentified entry 412A or 412B. Thus, the time of convergence to thecorrect location may be reduced.

In an embodiment, as shown in FIG. 5 and 6B, the X-axis may representtime domain. In other words, the horizontal X-axis may provide timestamps for the measured data sequence 420, for example. When thepositioning device 400 stops for some reason during the path 406A, forexample, the positioning device 400 starts to provide identical or closeto identical EMF measurements values. Also such a moment of standingstill may be detected by using another technique such as images capturedby the PD 400, an odometer, etc. Thus, it may be that the PD 400 isconfigured to capture images when measuring the first sequence 420,which images may be compared against an image database. The entityacquiring the first sequence 420 (OD 400 or database entity 500) mayneed to cut a part of the sequence 420 away, wherein the cut partcorresponds to the measurement performed while the positioning device400 is standing still. This may be needed so as to allow efficientcomparison against the true second sequence 422 of EMF values. It shouldbe noted that the second true sequence 422 may be measured by a movingmeasuring device.

However, in an embodiment, the X-axis represents distance moved by thepositioning device 400. The motion estimate needed for the distancerepresentation may be acquired from at least one motion sensor coupledto the positioning device 400. The motion sensor may be comprised in aninertial measurement unit (IMU). The motion sensor may comprise forexample at least one acceleration sensor or an odometer. The motionsensor may detect the movement of the positioning device and provide asoutput an estimate of the movement. The estimate may comprise at leastthe amount of movement, i.e. for example, how many meters thepositioning device 400 has moved and/or how many steps the personcarrying the PD 400 has taken. In addition, the direction of themovement may be determined by the motion sensor. The distanceinformation obtained may be used to pair the measured EMF value to adistance. Thus, it is possible to represent the first magnetic fieldsequence 420 as a function of distance with respect to the motion of thepositioning device 400. This may be beneficial for the comparison of twosequences 420 and 422. For example, the second sequence 422 may havebeen measured so that the measuring device 600 has been moving along thepath. Now the first sequence 420 may also be directly represented in thedistance domain. Thus, even if the person with the positioning device400 providing the first sequence 420 has stopped at some point along thepath, the first sequence 420 in the distance domain may still bedirectly comparable to the second sequence 422.

As said, the measuring device 600 measures the EMF vectors for the paths606A, 606B in a controlled manner in order to provide second sequences422A, 422B. The controlled manner may refer to the three-dimensionalorientation of a measuring device. In other words, the measuring device600 may be kept in a correct three-dimension orientation so that theframe of reference of the measuring device 600 corresponds to the frameof reference of the building 100, for example, as shown in FIG. 2B.However, a person carrying the positioning device 400 may not all thetime keep the positioning device 400 in correct angles with respect tothe frame of reference of the building 100 represented with XYZcoordinates. In particular, the positioning device 400 may be rotatedabout at least one of the three axis X, Y and Z, as shown in FIG. 2C.This may lead to inaccurate EMF measurements being carried out by thepositioning device 400 with respect to the direction of the EMF vectorbeing and, thus, lead to erroneous or inefficient location discoveryand/or tracking or to erroneous or non-optimal initial locationestimate. It should be noted that although observing the magnitude mayin some cases be sufficient for detecting the change of the operationalenvironment and/or for the location estimation/tracking, observing thedirection may provide additional accuracy and efficiency. This isbecause more information, including the direction, may be utilized. Forexample, when two entries have similar EMF magnitude models, theknowledge of the XYZ components of the EMF vector, or the knowledge ofthe both, the magnitude and the direction of the EMF vector may aid indifferentiating these entries. As said, the direction and the magnitudemay be derived from the XYZ components of the EMF vector. Therefore, inan embodiment, information indicating the three-dimensional orientationof the positioning device 400 may be acquired by the PD 400 or by thedatabase entity 500 at the at least one time instant when the EMF vectoris measured, wherein the EMF vector is measured by the positioningdevice 400 and defined in the frame of reference (X′, Y′, Z′) of thepositioning device 400, as shown in FIG. 20. However, (X′, Y′, Z′) isnot the same as (X, Y, Z). Thus, error may occur withoutadjusting/rotating/correcting the acquired EMF vector from the frame ofreference (X′, Y′, Z′) of the positioning device 400 to the frame ofreference (X, Y, Z) of the floor plan. The adjustment may be made atleast partly on the basis of the acquired information indicating thethree-dimensional orientation (X′, Y′, 1) of the positioning device 400.

The three-dimensional orientation of the measuring device 400 may bedefined by at least one of the following: a rotation with respect to afirst horizontal axis (such as X-axis or Y-axis), a rotation withrespect to a second horizontal axis (such as Y-axis or X-axis,respectively), and a rotation with respect to a vertical axis Z. Let usconsider this in more detail by referring to FIG. 7. In FIG. 7, thesolid arrows represent the world XYZ coordinate system and the dottedlines show the frame of reference of the positioning device 400. FIG. 7Ashows how the positioning device 400 may be rotated about Y-axis. InFIG. 7, the X direction represents the direction from the point (A) tothe point (B) in FIG. 6A, for example. That is, in FIG. 7A, the Y-axispoints towards the paper. In FIG. 7B, the positioning device 400 isrotated about X-axis, which points towards the paper. In order todetermine the amount of rotation about the Y-axis (FIG. 7A) and aboutX-axis (FIG. 7B), the positioning device may be in one embodimentequipped with inertial measurement unit (IMU) 472 as shown in FIG. 10.The IMU 472 may comprise at least one acceleration sensor utilizing agravitational field. The IMU 472 may optionally also comprise otherinertial sensors, such as at least one gyroscope, for detecting angularvelocities, for example. The acceleration sensor may be capable ofdetecting the gravitational force G. By detecting the accelerationcomponent G caused by the Earth's gravitation in FIGS. 7A and 7B, thepositioning device 400 may be able to determine the amount of rotationabout axis X and/or Y. In another embodiment, the IMU 472 may detect themovement of the person carrying the positioning device 400. This mayadvantageously allow the speed and direction of the person to bedetermined, thus resulting in determination of positioning device 400location along the path 606A at a given time, as indicated above.

Although the rotation about the X and Y axis may in general becorrectable because the global reference (the gravitational force G) ispresent, the rotation about the Z-axis as shown in FIG. 7C may not becorrected as easily. This may be due to lack of the global referencesimilar to G. Rotations relative to the positioning device 400 may bedetected by using the at least one gyroscope comprised in the IMU 472.However, the gyroscope may not be able to follow the absolute rotationin the world coordinate system. In addition, the gyroscope may driftfrom the correct orientation due to gyroscope sensor inaccuracies suchas sensor noise and bias. However, for the correction about the Z axis,another global reference may be used than the gravitational force G. Letus look at this next.

Let us assume that the positioning device 400 measures EMF vectors atany given point inside the building 100. Let us also assume that thereexists an EMF map for the building 100, or at least for a part of thebuilding 100, such as for the entries 412A, 412B. The EMF map mayindicate EMF vector magnitude and/or three-dimensional direction for agiven location in the building 100 or in a part of the building 100. Assaid, incorrect orientation of the positioning device 400 may lead toerroneous results or to a situation where only the magnitude of the EMFvector can be utilized but not the direction of the EMF vector inaddition to the magnitude of the EMF vector. Therefore it is beneficialto adjust the measured magnetic field vector from the frame of referenceof the positioning device 400 to the frame of reference of the floorplan the building 100. This may be done at least partly on the basis ofthe knowledge of the direction of the true magnetic field vector F, asreferred in FIG. 7C, at the location where the positioning device 400 isassumed to be located (i.e. at the location hypothesis of thepositioning device 400). It should be noted that the measured EMFvector, such as the first sequence 420, may originally be defined in theframe of reference of the positioning device 400 having an arbitrarythree-dimensional orientation, thus possibly leading to useless datawith respect to the EMF vector direction. The direction of the truemagnetic field vector for the at least one position hypothesis of thepositioning device 400 may be determined on the basis of a predeterminedEMF map at the at least one location corresponding to the at least oneposition hypothesis of the positioning device 400. The predetermined EMFmap may comprise position hypothesis outside the building and/or insidethe building. For example, when adjusting the measured EMF vectordirection with respect to the first sequence 420 (measured by thepositioning device 400), it may be beneficial to have true EMF vectorvalues also outside the building 100 along the path comprising the entryto the building 100. However, when correcting the measured EMF vectordirection for a PD 400 locating indoors, the predetermined EMF map maybe the indoor EMF map. When using multi-hypotheses location estimation,the number of hypotheses in the beginning may be large, such as over1000 hypotheses. However, by knowing the direction of references F and Gat each of the plurality of position hypothesis, the three-dimensionalorientation of the positioning device 400 may be adjusted to, or atleast close to, the correct frame of reference.

For example, when there are two position hypotheses, thethree-dimensional orientation adjustment at the correct locationhypothesis performs better than at the false location hypothesis. Thisis because, when correcting the rotation based on Earth's gravitation G,the inclination of the measured EMF vector should approach the true EMFvector inclination F. If this is not the case, the position hypothesismay be determined as not correct or the probability of the reliabilityof the position hypothesis may be given a low value. This is because ata false position hypothesis, a wrong EMF vector direction F may be used.On the contrary, the orientation adjustment at the correct positionhypothesis based on G, makes the measured inclination and trueinclination F to be closer to each other. Then, the three-dimensionalorientation correction based on F may be conducted, i.e. thethree-dimensional orientation of the positioning device 400 with respectto the rotation about the Z-axis may be corrected at least partly basedon F. The correction may be performed by the PD 400 or the databaseentity 500. Such three-dimensional orientation correction may beconducted even off-line if the positioning device 400 is equipped withthe EMF map data. This way the three-dimensional orientation of thepositioning device 400 may be adjusted properly and correct values ofEMF measurement vector may be obtained.

However, in case the rotation about the z-axis cannot be corrected,which may be due to the lack of EMF map data (i.e. a global reference)for the location or location hypothesis of the PD 400, it may still beadvantageous to determine the magnitude of the XY-plane projection andthe magnitude of the Z-component. As said, the rotations about theXY-plane may be corrected using the global reference G. Namely, the normof the XY-plane projection ∥m∥_(xy) of the EMF vector m=(x,y,z) may bedetermined as ∥m∥_(xy)=sqrt(x²+y²) even without adjusting the rotationabout the Z-axis. As a result, the feature vector (z, ∥m∥_(xy)) may becomputed from the tilt compensated magnetic field observation, whichfeature vector is invariant to the rotation about the Z-axis. These twofeatures enable for more EMF vector information than the magnitudealone, because the magnitude may be represented separately for theZ-axis component and for the XY-plane projection.

This may additionally allow for representing the first sequence 420 as afunction of distance which may be beneficial, as indicated before. Inthis case, the representation as a function of distance may be obtainedthrough the location estimation (e.g. by using a multi-hypothesislocation estimation) even without odometers or alike being comprised inthe positioning device 400. The orientation adjustment may allowefficient location estimation based on direction of the EMF 208, inaddition to or instead of the magnitude of the EMF 208. In anembodiment, the detection of operational environment change for thepositioning device, and the location estimation is conducted separatelyfor each entry of the building. In other words, the acquired measuredEMF data is compared against the EMF data provided by the map for eachentry location. As a result, each entry may be associated with alocation estimate of the positioning device 400 as a function of time.The location estimate may represent the distance moved by thepositioning device 400. As the location estimate is known for each entryas a function of time, each point of time may be associated with adistance moved and with a measured EMF vector (first sequence 420).Thus, it may be possible to generate the first sequence 420 as afunction of distance. At the correct entry location, the localizationresult may be statistically more consistent, and the similarity betweenthe mapped EMF vector sequence 422A, 422B and the first sequence 420 maybe higher.

In an embodiment, the three-dimensional orientation correction at leastpartly based on the true magnetic field vector direction F is performedfor determining probabilities for position hypotheses applied bymulti-hypothesis location estimation. In this case, the orientationcorrection may be performed at each position hypothesis. Themulti-hypothesis location estimation may comprise 1) applying a motionmodel for at least part of the position hypotheses based on the motioninformation, 2) orientation adjustment from the frame of reference ofthe PD 400 to the frame of reference of the building 100 (or to anotherpredetermined frame of reference), 3) comparing the measured,orientation adjusted EMF vector (or computed feature vector) to the EMFvector (or computed feature vector) acquired from the map at positionhypothesis, 4) determining probability of being a correct hypothesis foreach position hypothesis on the basis of the comparison and optionallyalso on the basis of the reliability of the orientation adjustment, and5) updating a posteriori probability distribution represented by theposition hypotheses. Step 1-5 may be repeated without limit for apredetermined number of times, or as long as a certain threshold withrespect to accuracy or characteristics of a posteriori probabilitydistribution is met. At some point in time, the position hypothesesclose to the correct position may have high probabilities, whereas thefalse positions may be associated with low probabilities (or lowerprobabilities). This way it may be determined, at each point of time,where the PD 400 is located in the building. Once the location estimatesare converged, the tracking of the object, such as the PD 400, may bestarted. The orientation correction using the map data as the globalreference may advantageously allow the multi-hypothesis locationestimation to converge faster to the correct position/locationhypothesis.

In an embodiment, the orientation correction is implemented, e.g., byapplying an orientation filter for MARG (Magnetic, Angular Rate, andGravity) sensor implementation in each position hypothesis. The MARGsensor contains a three-axis magnetometer, a three-axis angular ratesensor, and a three-axis accelerometer. The orientation filter can be,e.g., a quaternion, gradient decent, Kalman filter (KF), or extendedKalman filter (EKF) based implementation, or a hybrid implementation.Each position hypothesis may maintain own orientation estimate, which isperiodically updated, by the orientation filter, for each new sensorobservation consisting of acceleration, angular velocity, and magneticfield measurements. For each update step, the true EMF vector F is usedas the global magnetic field reference by the orientation filter. Thevector F is acquired from the map at the location indicated by thespecific location hypothesis, and is used by the orientation filtertogether with the sensor observation to update the orientation estimateof the specific location hypothesis.

In an embodiment as shown in FIG. 8, it is detected that the operationenvironment of the positioning device 400 has changed from the outdoorenvironment to the indoor environment. This may be done as describedearlier, for example, by observing changes in a property of the firstsequence 420. Next, the indoor location of the positioning device 400may be identified on the basis of a low range data transfer performed bythe positioning device 400, wherein the low range data transfer appliesat least one of the following: a radio frequency identification (RFD)technique, a Bluetooth communication protocol, a machine readable barcode, a IEEE 802.15.4 communication protocol. It should be noted that inan embodiment, the change of the operational environment of the PD 400may be detected on the basis of a low range data transfer performed bythe PD 400. Thus, in this case, no observation of the changes in aproperty of the first sequence 420 is needed. The PD 400 may be equippedwith suitable hardware and software (low range communication unit 476 ofFIGS. 8 and 10) which allows the PD 400 to communicate through the lowrange communication. For this reason, there may be a low rangecommunication unit 800 mounted at a predetermined location, such asclose to the entry point 412A, 412B of FIG. 4, for example. As thepredetermined location of the unit 800 is known, the initialization ofthe PD 400 with the identified location may be performed. For example,the location may be stored in the memory 804 operatively coupled to theunit 800 in order to initialize the PD 400 with the indoor locationestimate corresponding the identified location (i.e. the predeterminedlocation of the low range communication unit 800). The low rangecommunication unit 800 may provide communication properties in such alow range that it may be assumed that the PD 400, when communicativelycoupled to the low range communication unit 800, is in the same physicallocation as the low range communication unit 800. This may allow forfast convergence of the location estimation of the PD 400.

For example, let us assume that the low range communication unit 800 isthe first RFID unit 800. Then, the PD 400 also comprising a second RFIDunit 476 may read information comprised in the first RFID unit 800. Theinformation may comprise the location of the first RFID unit 800, forexample. Based on this information, the PD 400 may initialize itslocation estimate. The PD 400 may also activate the indoor navigationsystem, if not already activated. The information may be comprised inthe memory coupled to the first RFID unit 800, or the first RFID unit800 may provide access information to a network element where theinformation is stored. Alternatively, the first RFID unit 800 may readinformation from the second RFID unit 476 of the PD 400, wherein theinformation may comprise network access address of the PD 400. Thennetwork access equipment couple to the first RFID unit 800 may cause theinitialization of the PD 400 with the location estimate and possiblywith the EMF map data through the network. In either case, the data mayalso provide information enabling a network access establishment betweenthe PD 400 and a network element, such as the database entity 500. Theinformation may include network address of the PD 400 and/or the networkaddress of the network element, such as the database entity 500.

In an embodiment, the low range communication unit 800 may be coupled toa controller 802 and to a calibration circuitry & correction circuitryfor co-operating in calibration of the PD 400. For example, the exactmagnitude of the EMF may be predetermined and stored in the memory 804.Then the PD 400 may apply this information in obtaining knowledge of howmuch the measured EMF magnitude deviates from the indicated, true EMVmagnitude. Based on the information, a correction of the values providedby the magnetometer or calibration of the magnetometer may be in order.The calibration or correction process may be carried out in variousmanners. Let us consider the case where two RFID units are connected toeach other. The second RFID unit 476 of the PD 400 may receive the truemagnetic field information from the first RFID unit 800. Then thepositioning device 400 may apply the received information in calibrationof its magnetometer in order for the magnetometer to provide accurateand true EMF vector data. Alternatively, the positioning device 400 mayapply the received information in correcting each value provided by themagnetometer so as to provide accurate and true EMF vector data. Inanother embodiment, the PD 400 may inform the correction that needs tobe used for the EMF vector data received from this specific positioningdevice 400 to any element handling the EMF values provided by thisspecific positioning device 400. It should be clear that the differencebetween the true and measured EMF vectors may be determined at thepositioning device 400 or at the first RFID unit 800, as the case maybe. The calibration/correction may be for the strength of the EMFvector, and/or for an EMF bias (offset) vector affecting to the EMFmeasurements acquired by the positioning device 400. Alternatively, orin addition to, the calibration/correction may be for the direction ofthe EMF vector. The calibration process may also calibrate/correct datarelated to the direction and/or strength of the measured accelerationvector representing the direction of the gravitational force G. Forthis, the true value for G may be previously determined for thepredetermined location of the low range communication unit 800.

The exact location of the PD 400 after entry to the building 100 may bereferred to as a control point. The control point may be any point atwhich the location of the PD 400 may be accurately known. Therefore,according to the embodiment explained with reference to FIG. 6B, thedoor 412A may be seen as an example control point. The control point maybe the location where the magnetic field based navigation system in thePD 400 is activated and the initialization of the location of the PD 400is performed, for example. In an embodiment, the arrival to the controlpoint may be determined on the basis of the low range communication unit800 and/or on the basis of comparison of the first and the secondsequence, for example. In an embodiment, the arrival to the controlpoint may be determined on the basis of at least one image captured bythe positioning device 400 and compared to a database of imagesrepresenting the control points. The image may have been captured whenthe three-dimensional orientation of the PD 400 is according topredetermined rules. The database of images may reside in the memory ofthe PD 400 or of the database entity 500. In the latter case, either thedatabase of images is accessible by the PD 400 or the images captures bythe PD 400 are transmitted to the database entity 500 for review.

In an embodiment as shown in FIG. 9, upon detecting that the operationenvironment of the positioning device 400 has changed from the outdoorenvironment to the indoor environment (i.e. the PD 400 is indoors), adatabase entity 500 may acquire information on a path 900 thepositioning device 400 is expected to traverse and information on anexpected indoor magnetic field 208 sequence for the path 900. Theexpected sequence may be based on the indoor magnetic field map for thepath 900, wherein the EMF map may be stored in the memory of thedatabase entity 500. The information of the expected path 900 may beacquired manually from the user of the positioning device 400, forexample. Alternatively, the positioning device 400 may compriseinformation which indicates the path 900 of travel within the building100, such as an origin (X1, Y1) and a destination (X2, Y2). It mayfurther be that information on a measured indoor magnetic field isacquired from the positioning device 400 based on magnetic fieldmeasurements carried out by the positioning device 400 in the building100 during movement of the position device 400 along the path 900. Asthe database entity 500 may be aware of the expected sequence and themeasured sequence, the database entity 500 may determine whether thepositioning device 400 has deviated from the expected path 900 based ona comparison between the measured indoor magnetic field and the expectedindoor magnetic field sequence. There may be a threshold set, and whenthe threshold is exceeded, it may be determined that deviation has takenplace. The threshold may be with respect to the magnitude and/ordirection of the EMF vector in comparison with the expected sequence. Inorder to obtain the distance travelled, i.e. to be able to map themeasured EMF vector to a distance, the EMF based location tracking maybe conducted or the positioning device 400 may be equipped with anodometer or alike. When at least one predetermined criterion (such as apredetermined threshold) with respect to the comparison result is met,the database entity 500 may cause actuation of a software application inor with respect to the positioning device 400. Such software functionmay be for example removal of access right(s) in the building 100. Forexample, in FIG. 9 it may be determined at point (X3, Y3) that the PD400 has deviated from its expected path 900. Such determination may bebased on a predetermined amount of difference between the EMF vectormeasured and the corresponding EMF vector of the expected sequence.Alternatively, the sequence may be observed over several measuredvectors and when a predetermined number of vectors show differencesbetween the EMF vector measured and the corresponding EMF vector of thesequence, it may be determined that deviation has occurred. As said, atpoint (X3, Y3) the deviation may have been detected. Then the databaseentity 500 may remove access rights to the Room 3 from the PD 400. Thus,the door to Room 3 will not open to PD 400. That is, the positioningdevice 400 may be precoded with certain information related to accessrights within the building 400. Based on the deviation from the course900, the access rights may be changed, removed or added. In the lattercase, it may be seen that the deviation is allowable but the door toRoom 3 will not open to the PD 400. Therefore, it may be advantageous toadd access rights to the Room 3. In an embodiment, the database entity500 may inform the user of the PD 400 via a communication message to thePD 400 that a deviation has occurred and invite the user to return tothe expected path 900.

In an embodiment, the EMF bias (offset) vector affecting to the EMFvector measurements acquired by the positioning device 400 may bedetermined based on the difference between the measured EMF vector andthe true EMF vector at the location or at the location hypothesis of thepositioning device 400, wherein the true EMF vector may be obtained fromthe EMF map of the building 100. Once the bias is determined, it may beadded to or deducted from the measured value in order to obtain thecorrect EMF vector value, such as the correct magnitude of the EMF. Thebias thus represents the difference of the measured value and the truevalue. It may be that the bias is caused by the equipment to which thePD 400 is mounted, or by a metallic object locating near (e.g. in apocket or in a bag of a user) the PD 400. For example, when the PD 400is mounted to the shopping cart, the cart may cause the same bias to themeasured EMF values at each location of the building 100. Then it may beadvantageous to first measure the bias at one predetermined location andthen apply the bias in other places inside the building 100. Thepredetermined location may be detected as described above.Alternatively, the bias may be computed individually for each locationhypothesis at the beginning of the location estimation process, and thebias estimate for each hypothesis may be updatedincrementally/periodically during the location estimation and/ortracking process. It should be noted that this procedure may also aid indetermining probabilities for the location hypothesis. For example, ifthe location hypothesis, where the bias is determined, is correct, thebias is properly determined and may increase the probability of the truelocation hypothesis due to correct, bias adjusted EMF vectorobservations. However, if the location hypothesis is not correct, thebias determined at that position may be false. This false bias may alsolead to erroneous EMF vector observations from the point of view of theincorrect position hypothesis, which may decrease the probabilityassociated with the false location hypothesis, and, thus, promote thecorrect location/position hypothesis. In addition or alternatively tothe bias, a scaling factor may be similarly determined and applied. Thescaling factor may be used to calibrate the magnetometer of the PD 400so that it provides EMF vector magnitude values which are comparable tothe EMF vector magnitude values provided by another measuring deviceused to generate the EMF map. In addition, if the bias and/or scalingfactor are updated incrementally/periodically for each locationhypothesis, the statistical properties, such as variance, of thebias/scaling factor estimates may further provide information about thecorrectness of the specific position hypothesis.

Embodiments, as shown in FIGS. 10 and 11, provide apparatuses 400 and500 comprising at least one processor 452, 502 and at least one memory454, 504 including a computer program code, which are configured tocause the apparatuses to carry out functionalities according to theembodiments. The at least one processor 452, 502 may each be implementedwith a separate digital signal processor provided with suitable softwareembedded on a computer readable medium, or with a separate logiccircuit, such as an application specific integrated circuit (ASIC).

The apparatuses 400 and 500 may further comprise radio interfacecomponents 456 and 506 providing the apparatus 400, 500, respectively,with radio communication capabilities with the radio access network. Theradio interfaces 456 and 506 may be used to perform communicationcapabilities between the apparatuses 400 and 500. For the transmissionand/or reception of information, the apparatuses may apply, for example,wireless cellular radio network. Alternatively, for example, short rangeradio communication techniques including wireless local area network andBluetooth, may be applied. The radio interfaces 456 and 506 may be usedto communicate data related to the EMF map, the measured EMF vectors,location estimation, initialization, etc.

User interfaces 458 and 508 may be used in operating the measuringdevice 400 and the database entity 500 by a user. The user interfaces458, 508 may each comprise buttons, a keyboard, means for receivingvoice commands, such as microphone, touch buttons, slide buttons, etc.

The apparatus 400 may comprise the terminal device of a cellularcommunication system, e.g. a computer (PC), a laptop, a tabloidcomputer, a cellular phone, a communicator, a smart phone, a palmcomputer, or any other communication apparatus. In another embodiment,the apparatus is comprised in such a terminal device: e.g. the apparatusmay comprise a circuitry: e.g. a chip, a processor, a micro controller,or a combination of such circuitries in the terminal device and causethe terminal device to carry out the above-described functionalities.Further, the apparatus 400 may be or comprise a module (to be attachedto the terminal device) providing connectivity: such as a plug-in unit,an “USB dongle”: or any other kind of unit. The unit may be installedeither inside the terminal device or attached to the terminal devicewith a connector or even wirelessly. The apparatus 500 as the databaseentity may be comprised in the network accessible by the apparatus 400of FIG. 4.

As said, the apparatus 400, such as the positioning device, may comprisethe at least one processor 452. The at least one processor 452 maycomprise an indoor & outdoor navigation circuitry 460 for performingindoor or outdoor navigation. The indoor navigation may be on the basisof Earths magnetic field measurement and EMF map, on the basis of RFsignal strengths, and/or on the basis of visual or distance basedlocation estimation. The circuitry 460 may also be responsible foridentifying the correct position in the building 100 and to causeinitialization of the PD 400 with the location estimate and/or with theat least part of the EMF map. The circuitry 460 may apply for examplemulti-hypotheses location estimation. A detection circuitry 462 may befor detecting a change in the operational environment of the PD 400based on observing the first sequence 420 of FIG. 5 or based oncomparison of the first sequence 420 and the second sequence 422, forexample. An application activation circuitry 464 may be responsible ofactivation of a software function in or with respect to the PD 400. Suchfunction may be for example the check-in in Foursquare or FacebookPlaces, activation of indoor navigation system, change in the accessrights of the PD 400, etc. A calibration & correction circuitry 466 maybe responsible of performing a calibration process of a magnetometer 470and/or correcting the acquired information from the magnetometer 470,for example.

The magnetometer 470 may be used to measure the EMF vector. There may bevarious other sensors or functional entities comprised in thepositioning device 400. These may include an inertial measurement unit(IMU) 472, an odometer 474, a low range communication unit 476, a GPSsensor 478, a radio frequency (RE) based location tracking sensor 480,at last one camera 482, for example. A skilled person understood thatthere may be of use when performing the embodiments as describedearlier. For example, the RF based location tracking sensor 480 maydetect the RE signal from a near-by base station and determine alocation of the PD 400 based on the signal strength. The IMU 472 and theodometer 472 may be used to detect movement of the PD 400 and to enablethree-dimensional orientation estimation of the PD 400. The IMU 472 maycomprise for example acceleration sensor and a gyroscope, for example.The GPS sensor 478 may aid in outdoor navigation. The at least onecamera 482 may be used to capture images for the purposes of any of theembodiments described. As shown in FIG. 7A, the PD 400 may comprise onecamera on each side of the PD 400, i.e. cameras 482A and 482B) in orderto enable capturing images from the ceiling and from the floor, forexample. Such additional information may be useful in locating the PD400 in the building with more accuracy. The memory 454 may compriseinformation of the magnetic field map 490 and of the floor plan 492 ofthe building 100, for example. The memory may also be used for storingmeasured EMF values, for example. However, as said, the EMF map dataand/or the floor plan may be also stored in the apparatus 500, forexample, wherein the positioning device 400 has a network access to theapparatus 500.

Although not shown, the apparatus 400 may comprise a MARG sensor(described above) which may comprise or apply one or more of thefunctional entities of the apparatus 400, such as the magnetometer 470,an inertial measurement unit (IMU) 472, an odometer 474, etc.

The apparatus 500, such as the database entity, may comprise the atleast one processor 502. The at least one processor 502 may compriseseveral circuitries. As an example, an indoor navigation circuitry 510for performing indoor navigation on the basis of Earth's magnetic fieldmeasurement and EMF map, on the basis of RF signal strengths, and/or onthe basis of visual or distance based location estimation. For thenavigation, the memory 504 may comprise the EMF map 540 and the floorplan 542 of the building 100, for example, or have access to thatinformation. The circuitry 510 may perform the location discovery andtracking based on measured EMF vectors acquired from the positioningdevice 400. Then the database entity 500 may indicate the position ofthe PD 400 within the building 100. Alternatively, the circuitry 510 mayprovide, on request, at least part of the generated indoor magneticfield map to the positioning device 400 that is to determine itslocation inside the building to which the EMF map is applicable. Theindoor navigation circuitry 510 may provide the entire EMF map of thebuilding 100 to the positioning device 400 via network. Alternatively,the indoor navigation circuitry 510 may provide only a part of the EMFmap to the positioning device, wherein the part of the generated indoorEMF map to provide is selected on the basis of location estimate of thepositioning device. The location estimate may be acquired from anon-magnetic field based location discovery system. For example, if thebuilding is equipped with another location discovery system, such as forexample indoor base station based location discovery, the informationprovided by that other location technique may be used. Such additionaldata may obtained by the RF based location tracking unit 480 of thepositioning device 400, transmitted to the database entity 500 andprocessed in the database entity 500, for example. The informationstored relating to the other non-magnetic based navigation system maycomprise the mounting location of the indoor base stations, for example.By knowing the location of the positioning device 400, at least roughly,the circuitry 510 may then provide EMF map only for the area where thepositioning device 400 is currently moving, such as for the floor of thebuilding where the positioning device 400 currently is. This may beadvantageous so that only a part of the large EMF map needs to becommunicated to the positioning device. The positioning device 400 maythen use the map or part of the map in locating itself in the building100. The circuitry 510 may also be responsible for identifying thecorrect position in the building 100 and to cause initialization of thePD 400 with the location estimate and/or with the at least part of theEMF map 540. The circuitry 510 may apply for example multi-hypothesislocation estimator/tracker/filter.

A detection circuitry 512 may be for detecting a change in theoperational environment of the PD 400 based on observing the firstsequence 420 of FIG. 5 or based on comparison of the first sequence 420and the second, true sequence 422, for example. An applicationactivation circuitry 514 may be responsible of causing an activation ofa software function in or with respect to the PD 400. The databaseentity 500 may for example indicate to the PD 400 that an activation ofsoftware function is in order. Such function may be for example thecheck-in in Foursquare or Facebook Places, activation of indoornavigation system, removal of access rights, etc. A calibration &correction circuitry 516 may be responsible of causing or co-operatingin a calibration process of a magnetometer 470 of the PD 400 and/orcorrecting the acquired information from the magnetometer 470, forexample. The calibration may be performed by the circuitry 516 forexample when the low range data communication unit 800 of FIG. 8 isoperatively coupled to the database entity 500, for example. Further,the calibration & correction circuitry 516 may be responsible of makingthe orientation correction with respect to the frame of reference of thePD 400. As said, in an embodiment, the positioning device 400 is awareof the (X, Y. Z) world coordinate system and makes the correctionbetween the frame of references itself before indicating the directionof the EMF vector to the database entity 500. In another embodiment, themeasuring device 400 indicates the possibly uncorrected EMF vectordirection to the database entity 500 along with information regardingthe three-dimensional orientation of the measuring device 400, and thedatabase entity 500 makes the correction/adjustment by the calibration &correction circuitry 516 so as to yield the true direction of themagnetic field vector to be comprised in the generated EMF map.

As may be understood by a skilled person from the description of theembodiments throughout the application and from FIGS. 10 and 11, theembodiments may be performed in the positioning device 400, in thedatabase entity 500, or the execution of embodiments may be shared amongthe positioning device 400 and the database entity 500. The skilledperson also understands that any required filtering logic may be appliedto filter the EMF measurements in order to improve the accuracy.

As used in this application, the term ‘circuitry’ refers to all of thefollowing: (a) hardware-only circuit implementations, such asimplementations in only analog and/or digital circuitry, and (b)combinations of circuits and software (and/or firmware), such as (asapplicable): (i) a combination of processor(s) or (ii) portions ofprocessor(s)/software including digital signal processor(s), software,and memory(ies) that work together to cause an apparatus to performvarious functions, and (c) circuits, such as a microprocessor(s) or aportion of a microprocessor(s), that require software or firmware foroperation, even if the software or firmware is not physically present.This definition of ‘circuitry’ applies to all uses of this term in thisapplication. As a further example, as used in this application, the term‘circuitry’ would also cover an implementation of merely a processor (ormultiple processors) or a portion of a processor and its (or their)accompanying software and/or firmware. The term ‘circuitry’ would alsocover, for example and if applicable to the particular element, abaseband integrated circuit or applications processor integrated circuitfor a mobile phone or a similar integrated circuit in a server, acellular network device, or another network device.

The techniques and methods described herein may be implemented byvarious means. For example, these techniques may be implemented inhardware (one or more devices), firmware (one or more devices), software(one or more modules), or combinations thereof. For a hardwareimplementation, the apparatus(es) of embodiments may be implementedwithin one or more application-specific integrated circuits (ASICs),digital signal processors (DSPs), digital signal processing devices(DSPDs), programmable logic devices (PLDs), field programmable gatearrays (FPGAs), processors, controllers, micro-controllers,microprocessors, other electronic units designed to perform thefunctions described herein, or a combination thereof. For firmware orsoftware, the implementation can be carried out through modules of atleast one chip set (e.g. procedures, functions, and so on) that performthe functions described herein. The software codes may be stored in amemory unit and executed by processors. The memory unit may beimplemented within the processor or externally to the processor. In thelatter case, it can be communicatively coupled to the processor viavarious means, as is known in the art. Additionally, the components ofthe systems described herein may be rearranged and/or complemented byadditional components in order to facilitate the achievements of thevarious aspects, etc., described with regard thereto, and they are notlimited to the precise configurations set forth in the given figures, aswill be appreciated by one skilled in the art.

According to an embodiment, there is provided an apparatus comprisingprocessing means configure to carry out an embodiment according to anyof the FIGS. 1 to 11. In an embodiment, the at least one processor 452or 502, the memory 454 or 504, respectively, and a correspondingcomputer program code form an embodiment of processing means forcarrying out the embodiments of the invention.

Embodiments as described may also be carried out in the form of acomputer process defined by a computer program. The computer program maybe in source code form, object code form, or in some intermediate form,and it may be stored in some sort of carrier, which may be any entity ordevice capable of carrying the program. For example, the computerprogram may be stored on a computer program distribution medium readableby a computer or a processor. The computer program medium may be, forexample but not limited to, a record medium, computer memory, read-onlymemory, electrical carrier signal, telecommunications signal, andsoftware distribution package, for example.

Even though the invention has been described above with reference to anexample according to the accompanying drawings, it is clear that theinvention is not restricted thereto but can be modified in several wayswithin the scope of the appended claims. Therefore, all words andexpressions should be interpreted broadly and they are intended toillustrate, not to restrict, the embodiment. It will be obvious to aperson skilled in the art that, as technology advances, the inventiveconcept can be implemented in various ways. Further, it is clear to aperson skilled in the art that the described embodiments may, but arenot required to, be combined with other embodiments in various ways.

1. An apparatus, comprising: at least one processor and at least onememory including a computer program code, wherein the at least onememory and the computer program code are configured to, with the atleast one processor, cause the apparatus at least to: detect that apositioning device is within a predetermined control area associatedwith a building; acquire a first sequence of magnetic field measurementscarried out by the positioning device upon detecting that thepositioning device is within the predetermined control area, wherein thefirst sequence represents at least one of the magnitude and thedirection of Earth's magnetic field; determine that an operationalenvironment of the positioning device has changed between an indoorenvironment and an outdoor environment when at least one predeterminedcriterion with respect to at least part of the first sequence is met;and cause automatic actuation of a predetermined software function in orwith respect to the positioning device when the operational environmentof the positioning device has changed.
 2. The apparatus of claim 1,wherein the apparatus is further caused to: cause activation of eitheran application employing an indoor magnetic field based positioningsystem or an application employing an outdoor positioning system in thepositioning device when the operational environment of the positioningdevice has changed, wherein the application employing the indoormagnetic field uses an indoor magnetic field map representing at leastone of magnitude and direction of Earth's magnetic field affected by thelocal structures of the building at a given location inside thebuilding.
 3. The apparatus of claim 1, wherein the apparatus is furthercaused to: detect that the positioning device is within the control areaon the basis of positioning information obtained from the outdoorpositioning system and/or from the magnetic field based positioningsystem.
 4. The apparatus of claim 1, wherein the apparatus is furthercaused to: determine the direction of a true magnetic field vector forat least one position hypothesis of the positioning device, wherein thedirection of the true magnetic field vector for the at least oneposition hypothesis is based on a predetermined magnetic field map atthe at least one location corresponding to the at least one positionhypothesis of the positioning device, and wherein the predeterminedmagnetic field map is defined in a frame of reference of the floor planof the building; and adjust the measured magnetic field vector directionfrom a frame of reference of the positioning device to the frame ofreference of the floor plan the building at least partly on the basis ofthe direction of the true indoor magnetic field vector, wherein themeasured magnetic field vector is originally defined in the frame ofreference of the positioning device having an arbitrarythree-dimensional orientation.
 5. The apparatus of claim 1, wherein theapparatus is further caused to: acquire motion estimate of thepositioning device from at least one motion sensor coupled to thepositioning device; and apply the acquired motion estimate in order torepresent the first magnetic field sequence as a function of distancewith respect to the motion of the positioning device.
 6. The apparatusof claim 1, wherein the at least one criterion is a predetermined changein a property derivable from the first sequence.
 7. The apparatus ofclaim 1, wherein the at least one criterion is a predeterminedsimilarity between the first sequence and a second magnetic fieldsequence, wherein the second sequence is determined beforehand andrepresents a true magnetic field sequence for a path comprising a changeof operational environment.
 8. The apparatus of claim 7, wherein theapparatus is further caused to: acquire the second true magnetic fieldsequence, for at least one predetermined path based on magnetic fieldmeasurements carried out by at least one measuring device, wherein eachpredetermined path comprises an entry to the building; compare the firstmagnetic field sequence and the second true magnetic field sequence inorder to obtain a path hypothesis for the positioning device; anddetermine which of the at least one predetermined path the positioningdevice has traversed on the basis of the comparison.
 9. The apparatus ofclaim 1, wherein the apparatus is further caused to: detect that theoperation environment of the positioning device has changed from theoutdoor environment to the indoor environment; identify the indoorlocation of the positioning device on the basis of a low range datatransfer performed by the positioning device, wherein the low range datatransfer applies at least one of the following: a radio frequencyidentification technique, a Bluetooth communication protocol, a machinereadable bar code, a IEEE 802.15.4 communication protocol; and causeinitialization of the positioning device with the indoor locationestimate corresponding the identified location.
 10. The apparatus ofclaim 1, wherein the apparatus is further caused to: detect that theoperation environment of the positioning device has changed from theoutdoor environment to the indoor environment; acquire information on apath the positioning device is expected to traverse and information onan expected indoor magnetic field sequence for the path, wherein theexpected sequence is based on an indoor magnetic field map for the path;acquire information on a measured indoor magnetic field based onmagnetic field measurements carried out by the positioning device in thebuilding during movement of the positioning device along the path;determine whether the positioning device has deviated from the expectedpath based on a comparison between the measured indoor magnetic fieldand the expected indoor magnetic field sequence; and cause actuation ofa software application in or with respect to the positioning device whenat least one predetermined criterion with respect to the comparisonresult is met.
 11. The apparatus of claim 1, wherein the apparatus isfurther caused to: determine a bias or a scaling factor of the measuredmagnetic field vector based on the difference between the measuredmagnetic field vector and the true magnetic field vector at thelocation/location hypothesis of the positioning device, wherein the truemagnetic field vector is obtained from the indoor magnetic field map ofthe building; and apply the determined bias in locationestimation/tracking of the positioning device.
 12. A method, comprising:detecting that a positioning device is within a predetermined controlarea associated with a building; acquiring a first sequence of magneticfield measurements carried out by the positioning device, wherein thefirst sequence represents at least one of the magnitude and thedirection of Earth's magnetic field; determining that an operationalenvironment of the positioning device has changed between an indoorenvironment and an outdoor environment when a at least one predeterminedcriterion with respect to the first sequence is met; and causingautomatic actuation of a predetermined software function in or withrespect to the positioning device when the operational environment ofthe positioning device has changed.